<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script type="text/javascript">
    window.onload = function (){
        var question = document.getElementById("question");
        var optionA = document.getElementById("optionA");
        var optionB = document.getElementById("optionB");
        var optionC = document.getElementById("optionC");
        var optionD = document.getElementById("optionD");
        var btn = document.getElementById("btn");
        var form = document.getElementById("form")

        btn.onclick = function () {
            if(question.value != "" &&
               optionA.value != "" &&
               optionB.value != "" &&
                optionC.value != "" &&
                optionD.value != "" ){
                form.submit();
            }
        }
    }
</script>
<center>
    <form action="http://localhost:8080/onlineSystem/queAdd" id="form">
        <table>
            <tr>
                <td>题目</td>
                <td><input type="text" name="question" id="question"/></td>
            </tr>
            <tr>
                <td>选项A</td>
                <td><input type="text" name="optionA" id="optionA"/></td>
            </tr>
            <tr>
                <td>选项B</td>
                <td><input type="text" name="optionB" id="optionB"/></td>
            </tr>
            <tr>
                <td>选项C</td>
                <td><input type="text" name="optionC" id="optionC"/></td>
            </tr>
            <tr>
                <td>选项D</td>
                <td><input type="text" name="optionD" id="optionD"/></td>
            </tr>
            <tr>
                <td>正确答案</td>
                <td><input type="radio" name="answer" value="A" checked/>A
                <input type="radio" name="answer" value="B"/>B
                <input type="radio" name="answer" value="C"/>C
                <input type="radio" name="answer" value="D"/>D</td>
            </tr>
            <tr>
                <td><input type="button" value="提交" id="btn"/></td>
            </tr>
        </table>
    </form>
</center>
</body>
</html>